/*
 * @(#)SystemMonitorFilter.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.framework.web.model;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionMapping;

import com.dcivision.framework.GlobalConstant;
import com.dcivision.framework.SessionContainer;

/**
 * Represents the viewer helper role, restores the common contents of all of viewer.
 * 
 * @author   Brook.Huang
 * @company  DCIVision Limited
 * @creation date 30/05/2007
 * @version  $Revision: 1.1.2.4 $
 */
public class BasePageModel {

  public static final String PAGE_MODEL_KEY = "pageModel";

  protected String pageTitleKey = null;
  
  protected HttpServletRequest request = null;
  
  protected HttpServletResponse response = null;
  
  protected ActionMapping mapping = null;
  
  protected SessionContainer sessionContainer = null;

  protected BasePageModel(String pageTitleKey, ActionMapping mapping, HttpServletRequest request, HttpServletResponse response) {
    this.pageTitleKey = pageTitleKey;
    this.request = request;
    this.response = response;
    this.mapping = mapping;
    
    sessionContainer = (SessionContainer) request.getSession().getAttribute(GlobalConstant.SESSION_CONTAINER_KEY);
  }

  /**
   * @return the pageTtile
   */
  public String getPageTitleKey() {
    return pageTitleKey;
  }

  /**
   * @param pageTtile the pageTtile to set
   */
  public void setPageTitleKey(String pageTitleKey) {
    this.pageTitleKey = pageTitleKey;
  }

  /**
   * @return the mapping
   */
  public ActionMapping getMapping() {
    return mapping;
  }

  /**
   * @param mapping the mapping to set
   */
  public void setMapping(ActionMapping mapping) {
    this.mapping = mapping;
  }

  /**
   * @return the request
   */
  public HttpServletRequest getRequest() {
    return request;
  }

  /**
   * @param request the request to set
   */
  public void setRequest(HttpServletRequest request) {
    this.request = request;
  }

  /**
   * @return the response
   */
  public HttpServletResponse getResponse() {
    return response;
  }

  /**
   * @param response the response to set
   */
  public void setResponse(HttpServletResponse response) {
    this.response = response;
  }

  /**
   * @return the sessionContainer
   */
  public SessionContainer getSessionContainer() {
    return sessionContainer;
  }

  /**
   * @param sessionContainer the sessionContainer to set
   */
  public void setSessionContainer(SessionContainer sessionContainer) {
    this.sessionContainer = sessionContainer;
  }
  
}
